package cz.data.common.mark.mybatis;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import cz.data.common.mark.DbRow;
import cz.data.common.support.db.core.DbTable;
import org.apache.ibatis.annotations.Param;

public interface DynamicModelMapper {

    void createTable(DbTable table);

    void dropTable(DbTable table);

    int insertData(DbRow data);

    int updateData(@Param("data") DbRow data, @Param("ew") Wrapper wrapper);

    int deleteData(@Param("data") DbRow data, @Param("ew") Wrapper wrapper);

    IPage<JSONObject> getPageModelDatas(@Param("tableName") String tableName, @Param("ew") Wrapper wrapper, IPage<?> page);

    JSONObject getData(@Param("data") DbRow data, @Param("ew") Wrapper wrapper);

}
